/*
 * fml_gpio.h
 *
 *  Created on: 2025年4月9日
 *      Author: 22332
 */

#ifndef FML_GPIO_H_
#define FML_GPIO_H_

#include <stdbool.h>

typedef enum
{
	IN_LVDS_UNLOCK = 0x00U,
	IN_WAKEUP,
	IN_TFT_ERR,
	IN_LDO_1V2_PG,
	IN_SW_3V3_PG,
	IN_PMIC_FLTB,
	IN_BL_ERR,
} gpio_input;

typedef enum
{
	OUT_BL_PWM	=  0x00U,
	OUT_BL_EN,
	OUT_LVDS_PDB,
	OUT_PON_HOLD,
	OUT_TFT_BIST,
	OUT_TFT_SYBYB,
	OUT_TFT_DISP,
	OUT_TFT_SHLR,
	OUT_TFT_RST,
	OUT_TP_RST,
	OUT_3V3_TFT_EN,
	OUT_PMIC_EN,
	OUT_MCU_INT,
	OUT_LDO_1V2_EN,
} gpio_output;



typedef enum {
    GPIO_EVENT_RISING,
    GPIO_EVENT_FALLING,
    GPIO_EVENT_STABLE
} gpio_event_t;

typedef struct {
	gpio_input pin;
    uint8_t debounce_ms;
    uint8_t last_state;
    uint32_t timestamp;
} gpio_obj_t;


extern bool fml_gpio_read(uint8_t pos);
extern void fml_gpio_write(uint8_t pos,bool status);
extern void fml_gpio_init(void);


#endif /* FML_GPIO_H_ */
